package com.xkcyy.climb.persist;


import com.xkcyy.climb.core.dto.Paged;

import java.util.List;

/**
 * CriteriaQuery
 *
 * @author yuand
 * @date 2024/3/15
 **/
public interface CriteriaQuery<T> {
    CriteriaQuery<T> from(String classCode);

    CriteriaQuery<T> from(Class<?> entityClass);

    CriteriaQuery<T> where(Predicate predicate);

    CriteriaQuery<T> join(String classCode,Predicate on);

    CriteriaQuery<T> withRefObject(String refPropId,Predicate on);

    CriteriaQuery<T> orderBy(String property, Order order);

    <X> CriteriaQuery<T> select(Selection<X> selection);

    T fetch(Class<T> t);

    List<T> list(Class<T> t);

    Paged<T> page(Class<T> t);

    <X> X fetchScalar(Class<X> x);

    <X> List<X> listScalar(Class<X> x);

    long count();

}
